//
//  BaseWebView.swift
//  CodingTest
//
//  Created by LYPC on 2021/11/19.
//

import UIKit
import WebKit

open class BaseWebView: WKWebView {
    
    override public init(frame: CGRect, configuration: WKWebViewConfiguration) {
        super.init(frame: frame, configuration: configuration)
//        self.evaluateJavaScript("navigator.userAgent") { [weak self](result, error) in
//            guard error == nil,
//                var userAgent = result as? String else { return }
//            if !userAgent.contains("/yc-ios") {
//                userAgent.append("/yc-ios")
//            }
//            let dict = ["UserAgent": userAgent]
//            UserDefaults.standard.register(defaults: dict)
//            UserDefaults.standard.synchronize()
//            self?.customUserAgent = userAgent
//        }
    }
    
    @available(*, unavailable, message: "Loading this view from a nib is unsupported")
    public required init?(coder aDecoder: NSCoder) {
        fatalError("Loading this view from a nib is unsupported")
    }
}

